<template>
	<view>
		<view class="wid90 mar">
			<view style="height: 20rpx;"></view>
			<!-- <view class="foSi40 mar-bott20 fowe600 dis disAl disJuC" style="min-height: 80rpx;">{{data.title}}</view> -->
			<rich-text :nodes="data"></rich-text>
			<view style="height: 40rpx;"></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: '',
				id: ''
			}
		},
		onLoad(options) {
			this.id = options.id
			this.list()
		},
		methods: {
			list: async function() {
				let that = this
				this.$u.api.news_detail({
					id: this.id
				}).then(res => {
					if (res.code) {
						var data = res.data.content
						console.log(data);
						data = data.replace(/<img/gi, "<img class='richImg'");
						that.data = data
					}
				});
			}
		}
	}
</script>

<style>
	.richImg {
	    width: 100% !important;
	    height: auto !important;
	}
</style>
